home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / lan / tliws3.zip / DOS / TISPXIPX.H < prev    next >
C/C++ Source or Header  |  1992-12-16  |  6KB  |  169 lines

  1. /****************************************************************************
  2.  *
  3.  * (C) Unpublished Copyright of Novell, Inc. All Rights Reserved.
  4.  *
  5.  * No part of this file may be duplicated, revised, translated, localized or
  6.  * modified in any manner or compiled, linked or uploaded or downloaded to or
  7.  * from any computer system without the prior written consent of Novell, Inc
  8.  *
  9.  ***************************************************************************/
  10.  
  11.  /*
  12.   *   SPX/IPX Specific Values and Structures for TLI
  13.   */
  14.  
  15. #ifndef _TISPXIPX_
  16. #define _TISPXIPX_
  17.  
  18. typedef struct ipxaddr_s 
  19.     {
  20.    unsigned char    ipxa_net[4];
  21.    unsigned char    ipxa_node[6];
  22.    unsigned char    ipxa_socket[2];
  23.     }
  24.     IPX_ADDR;
  25.  
  26. typedef    struct ipxopt_s
  27.     {
  28.    unsigned char    ipx_type;        /* type field for ipx header            */
  29.    unsigned char    ipx_pad1[3];     /* pad structure to 4 bytes, set to 0's */
  30.    unsigned char    ipx_hops;        /* Transport Control (hop count)        */
  31.    unsigned char    ipx_pad2[3];     /* pad structure to 8 bytes, set to 0's */
  32.     }
  33.     IPX_OPTS;
  34.  
  35. /*
  36.  *   SPX Options structure (Previous to 4.0 ) 
  37.  *
  38.  *   SPX II option structure, used if t_open("nspx",...) as oppossed to nspx2.
  39.  */
  40. typedef struct spxopt_s
  41.     {
  42.    unsigned char    spx_connectionID[2];
  43.    unsigned char    spx_allocationNumber[2];
  44.    unsigned char    spx_pad1[4];    /* pad structure to 8 bytes, set to 0's */
  45.     }
  46.     SPX_OPTS;
  47.  
  48. typedef struct spx_optmgmt
  49.     {
  50.    unsigned char    spxo_retry_count;
  51.    unsigned char    spxo_watchdog_flag;
  52.    unsigned long    spxo_min_retry_delay;
  53.    unsigned char    spxo_pad2[2];    /* pad structure to 8 bytes, set to 0's */
  54.     }
  55.     SPX_OPTMGMT;
  56.  
  57. /*
  58.  *   SPX Options structure (New to 4.0 and later) 
  59.  *
  60.  *   SPX II option structure, used if t_open("nspx2",...) as oppossed to nspx.
  61.  *   This stucture is used for all option managment settings and inquiries.
  62.  *   Not all members are set/returned in every option management call.
  63.  *   Option managment calls which use this common structure are:
  64.  *
  65.  *   t_getinfo    - returns size of SPX2_OPTIONS (changes as versions change)
  66.  *   t_optmgmt    - sends/returns SPX2_OPTIONS to/from protocol provider 
  67.  *   t_accept     - sends SPX2_OPTIONS structure to protocol provider
  68.  *   t_connect    - sends and, if not O_NDELAY,  returns SPX2_OPTIONS 
  69.  *      t_rcvconnect - returns SPX2_OPTIONS from the provider
  70.  *   t_listen     - returns SPX2_OPTIONS from the provider
  71.  */
  72.   
  73. #define    OPTIONS_VERSION   1
  74.  
  75. /* Option version history */
  76.  
  77. #if OPTIONS_VERSION    == 1
  78. #define            OPTIONS_SIZE    (13 * sizeof (long))
  79. #endif
  80.  
  81. typedef struct spx2_options
  82.     {
  83.    unsigned long    versionNumber;           /* must be set to OPTIONS_VERSION */    
  84.    unsigned long  spxIIOptionNegotiate;  
  85.    unsigned long  spxIIRetryCount;       
  86.    unsigned long  spxIIMinimumRetryDelay;
  87.    unsigned long  spxIIMaximumRetryDelta;
  88.    unsigned long  spxIIWatchdogTimeout;  
  89.    unsigned long  spxIIConnectTimeout;   
  90.    unsigned long  spxIILocalWindowSize;  
  91.    unsigned long  spxIIRemoteWindowSize; 
  92.    unsigned long  spxIIConnectionID;     
  93.    unsigned long  spxIIInboundPacketSize;
  94.    unsigned long  spxIIOutboundPacketSize;
  95.    unsigned long  spxIISessionFlags;       /* version 1 ends */
  96.     }
  97.     SPX2_OPTIONS;
  98.  
  99.  
  100. /* SPX and SPX II Option Management values */
  101.  
  102. #define SPX_WATCHDOG_OFF      0
  103. #define SPX_WATCHDOG_ON       ! SPX_WATCHDOG_OFF
  104. #define SPX_WATCHDOG_DEFAULT  SPX_WATCHDOG_ON
  105.  
  106. /* SPX options only above here */ 
  107.  
  108. #define SPX_RETRY_MIN         3
  109. #define SPX_RETRY_MAX         50
  110. #define SPX_RETRY_DEFAULT     10
  111.  
  112. /* SPX II options only below here */
  113.  
  114. #define SPX_WATCHDOG_TIMEOUT_MIN       3000     /* msec == 3 seconds              */
  115. #define SPX_WATCHDOG_TIMEOUT_MAX       300000   /* msec == 5 minutes              */
  116. #define SPX_WATCHDOG_TIMEOUT_DEFAULT   60000    /* msec == 1 minute              */
  117.  
  118. #define SPX_MIN_RETRY_DELAY_MIN        1        /* msec                              */
  119. #define SPX_MIN_RETRY_DELAY_MAX        60000    /* msec == 1 minute              */
  120. #define SPX_MIN_RETRY_DELAY_DEFAULT    0        /* Protocol provider decides */
  121.  
  122. #define SPX_MAX_RETRY_DELTA_MIN        1000     /* msec == 1 second              */
  123. #define SPX_MAX_RETRY_DELTA_MAX        60000    /* msec == 1 minute              */
  124. #define SPX_MAX_RETRY_DELTA_DEFAULT    5000     /* msec == 5 seconds              */
  125.  
  126. #define SPX_OPTION_NEGOTIATE_OFF       0
  127. #define SPX_OPTION_NEGOTIATE_ON        ! SPX_OPTION_NEGOTIATE_OFF
  128. #define SPX_OPTION_NEGOTIATE_DEFAULT   SPX_OPTION_NEGOTIATE_ON
  129.  
  130. #define SPX_CONNECT_TIMEOUT_MIN        1000     /* msec == 1 second              */
  131. #define SPX_CONNECT_TIMEOUT_MAX        120000   /* msec == 2 minutes              */
  132. #define SPX_CONNECT_TIMEOUT_DEFAULT    0        /* Protocol provider decides */
  133.  
  134. #define SPX_LOCAL_WINDOW_SIZE_MIN      1
  135. #define SPX_LOCAL_WINDOW_SIZE_MAX      8
  136. #define SPX_LOCAL_WINDOW_SIZE_DEFAULT  0        /* Protocol provider decides */
  137.  
  138. #define SPX2_SF_NONE                   0x00     /* Session flags, None       */
  139. #define SPX2_SF_IPX_CHECKSUM           0x01     /* Session flags, IPX Xsum   */
  140. #define SPX2_SF_SPX2_SESSION           0x02
  141.  
  142.  
  143.  
  144. /* Misc. byte aligned data access macros */
  145.  
  146. #ifndef    BE16_TO_U16
  147. #define    BE16_TO_U16(a)    ((((u16)((u8 *)a)[0] << (u16)8) | ((u16)((u8 *)a)[1] & 0xFF)) & (u16)0xFFFF)
  148. #define    BE32_TO_U32(a)    ((((u32)((u8 *)a)[0] & 0xFF) << (u32)24) | (((u32)((u8 *)a)[1] & 0xFF) << (u32)16) | (((u32)((u8 *)a)[2] & 0xFF) << (u32
  149. #define    U16_TO_BE16(u,a) ((((u8 *)a)[0] = (u8)((u) >> 8)), (((u8 *)a)[1] = (u8)(u)))
  150. #define    U32_TO_BE32(u,a) ((((u8 *)a)[0] = (u8)((u) >> 24)), (((u8 *)a)[1] = (u8)((u) >> 16)), (((u8 *)a)[2] = (u8)((u) >> 8)),(((u8 *)a)[3] = (
  151. #endif
  152.  
  153. /* T_DISCONNECT reason codes for SPX */
  154.  
  155. #define TLI_SPX_CONNECTION_FAILED       0xed
  156. #define TLI_SPX_CONNECTION_TERMINATED   0xec    /* T_DISCONNECT from remote */
  157. #define TLI_SPX_MALFORMED_PACKET        0xfe
  158. #define TLI_SPX_PACKET_OVERFLOW         0xfd    /* This is the preferred one */
  159. #define TLI_SPX_UNREACHABLE_DEST        0x70    /* route not found */
  160.  
  161. /* t_rcvuderr uderr.error codes for IPX */
  162.  
  163. #define TLI_IPX_MALFORMED_ADDRESS       0xfe
  164. #define TLI_IPX_PACKET_OVERFLOW         0xfd
  165.  
  166. #endif
  167.  
  168.  
  169.